import { createVNode, render } from 'vue';
import Loading from '../components/Loading.vue';

// 创建一个DOM容器
const container = document.createElement('div');
document.body.appendChild(container);

// 创建Loading实例
const vnode = createVNode(Loading);
render(vnode, container);

// 获取组件实例
const loadingInstance = vnode.component.exposed;

// 导出方法
export default {
  show() {
    loadingInstance.show();
  },
  hide() {
    loadingInstance.hide();
  }
};